package com.bc.bczbweb.controller;

import com.bc.commoncore.util.StringUtils;
import com.bc.commonentity.common.JsonResult;
import com.bc.bcapi.service.T_User_walletService;
import com.bc.bcmodel.domain.T_User_walletModel;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

import java.math.BigInteger;

import org.springframework.web.bind.annotation.RequestMethod;

@Controller
@RequestMapping("t_user_wallet")
public class T_User_walletController extends BaseController {
    @Autowired
    T_User_walletService t_User_walletService;

    @RequestMapping("list")
    public ModelAndView list() {
        ModelAndView view = super.baseView("列表", "t_user_wallet/list");
        return view;
    }

    @RequestMapping(value = "listdo", method = RequestMethod.POST)
    public ModelAndView listdo(T_User_walletModel req) {
        ModelAndView view = super.baseViewAjax("列表", "t_user_wallet/listdo");
        view.addObject("data", null);
        return view;
    }

    @RequestMapping("add")
    public ModelAndView add(BigInteger id) {
        String title = id.intValue() > 0 ? "编辑" : "添加";
        ModelAndView view = super.baseView(title, "t_user_wallet/add");
        T_User_walletModel model = new T_User_walletModel();
        model.setId(id);
        T_User_walletModel data = t_User_walletService.findByNamedParam(model);
        view.addObject("data", data);
        view.addObject("title", title);
        return view;
    }
}